package com.njupt.user.service;/*
 @author liu
 @DESCRIPTION ${DESCRIPTION}
*/

import com.njupt.user.dao.UserMapper;
import com.njupt.user.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("UserService")
public class UserServiceimpl implements UserService {


    @Autowired
    private UserMapper userMapper;

    //查询用户service接口实现
    @Override
    public List<User> selectUser(Map map){
        return userMapper.selectUser(map);
    }


    @Override
    public User getUser(Map<String, String> map){
        User user = userMapper.getUser(map);
        return user;
   }


    @Override
    public User getUser1(Map<String, String> map){
        User user = userMapper.getUser1(map);
        return user;
    }


    @Override
    public void updateUser(Map map){
       userMapper.updateUser(map);
    }


    @Override
    public User getOneUser(String username) {
        return userMapper.getOneUser(username);
    }


    @Override
    public void updatePassword(Map<String, String> map) {
        userMapper.updatePassword(map);

    }


    @Override
    public List<User> findAll() {
        return userMapper.findAll();
    }



    @Override
    public List<User> findByPage(int nowpage) {
        return userMapper.findByPage(nowpage);
    }



    @Override
    @SuppressWarnings("rawtypes")
    public List<User> findBylikeNow(Map map) {
        return userMapper.findBylikeNow(map);
    }



    //用户注册
    @Override
    public void register(Map map) {
        userMapper.addUser(map);
    }

    @Override
    public List<User> findUserByUsername(Map<String, String> map) {
        return userMapper.findUserByUsername(map);
    }


    @Override
    public List<User> getUserById(int userid) {
        List<User> list=userMapper.getUserById(userid);
        return list;
    }



    @Override
    @SuppressWarnings("rawtypes")

    public void frozenOrNot(Map map) {

        userMapper.frozenOrNot(map);
    }



    @Override
    @SuppressWarnings("rawtypes")

    public void updateTypeByid(Map map) {
        userMapper.updateTypeByid(map);

    }






    //密码找回
    @Override
    @SuppressWarnings("rawtypes")
    public User retrieve(Map map) {

        return userMapper.retrieve(map);
    }

    @Override
    @SuppressWarnings("rawtypes")

    public void invest(Map map) {

        userMapper.invest(map);

    }



    @Override
    @SuppressWarnings("rawtypes")
    public void coin(Map map) {
        userMapper.coin(map);

    }

}
